package entities.concept;

import java.util.ArrayList;


import entities.role.PathExpression;
import entities.vocabulary.KBVocabulary;


/**
 * Restricted PFD constructor:
 * <br>C: pf1, ..., pf.pfi, ..., pfk -> pf
 * <br>C: pf1, ..., pf.pfi, ..., pfk -> pf.f
 * @author j55wu
 *
 */

public class PFDConcept {

	private Concept c;
	private ArrayList<PathExpression> lhspf;
	
	private PathExpression rhspf;
	
	public PFDConcept(Concept c, ArrayList<PathExpression> pfs, PathExpression pf){
		this.c = c;
		this.lhspf = pfs;
		this.rhspf = pf;
	}
	
	public Concept getC() {
		return c;
	}

	public ArrayList<PathExpression> getLhspf() {
		return lhspf;
	}

	public PathExpression getRhspf() {
		return rhspf;
	}

	
	//unary pfs
	public PFDConcept(Concept c, PathExpression pf1, PathExpression pf2){
		this.c = c;
		this.lhspf = new ArrayList<PathExpression> ();
		this.lhspf.add(pf1);
		this.rhspf = pf2;
	}
	
	public boolean isLHSPFUnary(){
		return this.lhspf.size() == 1;
	}
	
	public boolean isLHSKey(){
		return this.rhspf == KBVocabulary.Id;
	}
}
